package jheej5024;

public class J28_PrinterInterface {

	//인터페이스를 사용하지 않은 경우
	//프린터 제조사를예를 듦
	
	public static void main(String[] args) {
		HPPrinter h = new HPPrinter();
		h.speedPrint();
		CanonPrinter c = new CanonPrinter();
		c.hyperPrint();
		EpsonPrinter e = new EpsonPrinter();
		e.nanoPrint();
		HPPrinterDrivier h1 = new HPPrinterDrivier();
		h1.Print();
		CanonPrinterDriver c1 = new CanonPrinterDriver();
		c1.Print();
		EpsonPrinterDriver e1 = new EpsonPrinterDriver();
		e1.Print();
		
        //인터페이스를 이용한 다형성
		Printable p = new HPPrinterDrivier();
		p.Print();
		p = new CanonPrinterDriver();
		p.Print();
		p= new EpsonPrinterDriver();
		p.Print();
		
	}

}

class HPPrinter { 
	public void speedPrint(){
		System.out.println("빠른 출력속도!! - HP");
	}
}

class CanonPrinter {
	public void hyperPrint(){
		System.out.println("절대속도에 도전 - canon");
	}
}

class EpsonPrinter {
	public void nanoPrint(){
		System.out.println("눈깜빡할 속도 - Epson");
	}
}

interface Printable {
	
	public void Print();
	
}


class HPPrinterDrivier implements Printable 
{

	@Override
	public void Print() {
		System.out.println("빠른 출력속도!! - HP");
	
	}	
}
	
class CanonPrinterDriver implements Printable {
	@Override
	public void Print() {
		System.out.println("절대속도에 도전 - canon");
		
	}
}
class EpsonPrinterDriver implements Printable
{
	@Override
	public void Print() {
		System.out.println("눈깜빡할 속도 - Epson");
		
	}
}

	














